<script>
  export default {
    data() {
      return{
        form: {},
        tableData: [],
        page: 1,
        size: 100,
        total: 0,
      }
    },
    methods: {
      findPage(){
        this.axios.post('http://localhost:9000/a/operation-log/findPage?page='+this.page+'&size='+this.size,this.form).then(res => {
          this.tableData = res.data.records;
          this.total = res.data.total;
        })
      },
      handleSizeChange(size) {
        this.size = size;
        this.findPage();
      },
      handleCurrentChange(page) {
        this.page = page;
        this.findPage();
      },



    },
    created() {
      this.findPage();
    }
  }
</script>

<template>
  <div>
    <el-form :inline="true" :model="form" >
      <el-form-item label="操作人">
        <el-input v-model="form.username" placeholder="审批人"></el-input>
      </el-form-item>
      <el-form-item label="操作开始结束日期">
        <el-date-picker
            v-model="form.start"
            type="date"
            placeholder="开始日期">
        </el-date-picker>
        <el-date-picker
            v-model="form.end"
            type="date"
            placeholder="结束日期">
        </el-date-picker>

      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="findPage">查询</el-button>
      </el-form-item>
    </el-form>

    <template>
      <el-table
          :data="tableData"
          stripe
          style="width: 100%">
        <el-table-column
            prop="username"
            label="操作人">
        </el-table-column>
        <el-table-column
            prop="time"
            label="操作时间">
        </el-table-column>
        <el-table-column
            prop="ip"
            label="IP">
        </el-table-column>
        <el-table-column
            prop="name"
            label="操作详细">
        </el-table-column>
      </el-table>

    </template>
<!--    <el-pagination-->
<!--        @size-change="handleSizeChange"-->
<!--        @current-change="handleCurrentChange"-->
<!--        :current-page.sync="page"-->
<!--        :page-size="size"-->
<!--        layout="total, prev, pager, next"-->
<!--        :total="total">-->
<!--    </el-pagination>-->


  </div>
</template>

<style>

</style>